import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'layout',
    component: () => import("@/views/layout"),
    children: [
      {
        path: '',
        name: 'home',
        component: () => import("@/views/home")
      },
      {
        path: '/classify',
        name: 'classify',
        component: () => import("@/views/classify")
      },
      {
        path: '/shop',
        name: 'shop',
        component: () => import("@/views/shop")
      },
      {
        path: '/my',
        name: 'my',
        component: () => import("@/views/my")
      },
      
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import("@/views/login")
  },
  {
    path: '*',
    name: '404',
    component: () => import("@/views/404")
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
